#include "SettingsWidget.h"
#include "ui_SettingsWidget.h"
#include "Capture/DisplayInfo.h"
#include <QDesktopWidget>

SettingsWidget::SettingsWidget(QWidget *parent) :
	QWidget(parent),
	ui(new Ui::SettingsWidget)
{
	ui->setupUi(this);

	DisplayInfo info;
	info.init();
	int cnt = info.displayCount();
	ui->lb_display_count->setText(QString("%1").arg(cnt));
	QString res;
	if(cnt == 1){
		res = QString("%1x%2").arg(QApplication::desktop()->width()).arg(QApplication::desktop()->height());
	}
	else{
		for(int i=0;i<cnt;i++){
			res += QString("%1. %2x%3  ").arg(i+1).arg(info.width(i)).arg(info.height(i));
		}
	}
	ui->lb_resolution->setText(res);
}

SettingsWidget::~SettingsWidget()
{
	delete ui;
}
